home *** CD-ROM | disk | FTP | other *** search
- {Listing 4}
- procedure TMainForm.WMNCLButtonDblClk(var Msg: TWMNCLButtonDblClk);
- var
- tScreenPt, ClientPt: TPoint;
- begin
- ScreenPt.X := Msg.XCursor;
- ScreenPt.Y := Msg.YCursor;
- ClientPt := ScreenToClient(ScreenPt);
- if (Msg.HitTest = htMenu) and (ClientPt.X < GetSystemMetrics(sm_CYMenu))
- and (ActiveMDIChild <> nil) and
- (ActiveMDIChild.WindowState = wsMaximized) then begin
- ActiveMDIChild.Close;
- Msg.Result := 0;
- end else
- inherited;
- end;